home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / cdrtools-1.10 / include / btorder.h next >
Encoding:
C/C++ Source or Header  |  2000-01-05  |  2.4 KB  |  86 lines

  1. /* @(#)btorder.h    1.11 00/01/05 Copyright 1996 J. Schilling */
  2. /*
  3.  *    Definitions for Bitordering
  4.  *
  5.  *    Copyright (c) 1996 J. Schilling
  6.  */
  7. /*
  8.  * This program is free software; you can redistribute it and/or modify
  9.  * it under the terms of the GNU General Public License as published by
  10.  * the Free Software Foundation; either version 2, or (at your option)
  11.  * any later version.
  12.  *
  13.  * This program is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.  * GNU General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU General Public License
  19.  * along with this program; see the file COPYING.  If not, write to
  20.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  */
  22.  
  23.  
  24. #ifndef    _BTORDER_H
  25. #define    _BTORDER_H
  26.  
  27. #include <sys/types.h>            /* try to load isa_defs.h on Solaris */
  28.  
  29. #ifndef _MCONFIG_H
  30. #include <mconfig.h>
  31. #endif
  32.  
  33. #if defined(HAVE_C_BITFIELDS)    && \
  34.     defined(BITFIELDS_LTOH)        /* Use definition from xconfig.h */
  35. #define    _BIT_FIELDS_LTOH
  36. #endif
  37.  
  38. #if defined(HAVE_C_BITFIELDS)    && \
  39.     defined(BITFIELDS_HTOL)        /* Use definition from xconfig.h */
  40. #define    _BIT_FIELDS_HTOL
  41. #endif
  42.  
  43. #if defined(HAVE_C_BITFIELDS)    && \
  44.    !defined(BITFIELDS_HTOL)        /* Use definition from xconfig.h */
  45. #define    BITFIELDS_LTOH
  46. #define    _BIT_FIELDS_LTOH
  47. #endif
  48.  
  49.  
  50. #if    defined(_BIT_FIELDS_LTOH) || defined(_BIT_FIELDS_HTOL)
  51. /*
  52.  * Bitorder is already known.
  53.  */
  54. #else
  55. /*
  56.  * Bitorder not yet known.
  57.  */
  58. #    if defined(sun3) || defined(mc68000) || \
  59.        defined(sun4) || defined(__sparc) || defined(sparc) || \
  60.        defined(__hppa) || defined(_ARCH_PPC) || defined(_IBMR2)
  61. #        define _BIT_FIELDS_HTOL
  62. #    endif
  63.  
  64. #    if defined(__sgi) && defined(__mips)
  65. #        define _BIT_FIELDS_HTOL
  66. #    endif
  67.  
  68. #    if defined(__i386__) || defined(__i386) || defined(i386) || \
  69.        defined(__alpha__) || defined(__alpha) || defined(alpha) || \
  70.        defined(__arm__) || defined(__arm) || defined(arm)
  71. #        define _BIT_FIELDS_LTOH
  72. #    endif
  73.  
  74. #    if defined(__ppc__) || defined(ppc) || defined(__ppc) || \
  75.        defined(__PPC) || defined(powerpc) || defined(__powerpc__)
  76.  
  77. #        if    defined(__BIG_ENDIAN__)
  78. #            define _BIT_FIELDS_HTOL
  79. #        else
  80. #            define _BIT_FIELDS_LTOH
  81. #        endif
  82. #    endif
  83. #endif
  84.  
  85. #endif    /* _BTORDER_H */
  86.